package com.zhipu.resetbalance.utils;

import com.blankj.utilcode.util.TimeUtils;
import com.zhipu.resetbalance.mobile.dao.InspectorEntityDao;
import com.zhipu.resetbalance.mobile.dao.NumberedEntityDao;
import com.zhipu.resetbalance.mobile.event.InspectorEntity;
import com.zhipu.resetbalance.mobile.event.NumberedEntity;

import java.util.List;

public class DataGenerateUtils {


    /**
     * 数据生成
     */
    public static void dataPersonnel(){
        List<InspectorEntity> mInspectorEntityList = InspectorEntityDao.getInstance().getAllList();
        if(null == mInspectorEntityList || mInspectorEntityList.size() == 0){
            InspectorEntity mInspectorEntity = new InspectorEntity();
            /**
             * 名称
             */
            mInspectorEntity.InspectorName = "admin";
            /**
             * 创建时间
             */
            mInspectorEntity.creationTime = TimeUtils.getNowMills();
            /**
             * 添加
             */
            mInspectorEntity.save();
        }
    }

    /**
     * 数据生成
     */
    public static void dataNumber(){
        List<NumberedEntity> mNumberList = NumberedEntityDao.getInstance().getAllList();
        if(null == mNumberList || mNumberList.size() == 0){
            NumberedEntity mNumberedEntity = new NumberedEntity();
            /**
             * 名称
             */
            mNumberedEntity.NumberedName = "ZJTZSP";
            /**
             * 创建时间
             */
            mNumberedEntity.creationTime = TimeUtils.getNowMills();
            /**
             * 默认选中
             */
            mNumberedEntity.select = true;
            /**
             * 添加
             */
            mNumberedEntity.save();
        }
    }
}
